<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
</head>
<body>
<div th:fragment="input(type,name,label,isRequired)" class="form-group">
    <label th:if="${!#strings.isEmpty(label)}"
           th:replace="fragments/crud/label :: default(${name},${label},${isRequired})"></label>
    <div class="col-sm-6">
        <input th:type="${type}" th:name="${name}" th:id="${name}" class="form-control"
               th:classappend="${isRequired?'required':''}"
               th:placeholder="${label}"/>
    </div>
    <script th:replace="fragments/crud/valid :: default(${name},${label})"></script>
</div>
<div th:fragment="input-bridge(type,name,feature)"
     th:replace="fragments/crud/new-input :: input(${type},${name},${#strings.contains(feature,'[')?(#strings.substring(feature,#strings.indexOf(feature,'[')+1,#strings.indexOf(feature,']'))):null},${!#strings.contains(feature,'![')})">
</div>
<div th:fragment="text(name,feature)"
     th:replace="fragments/crud/new-input :: input-bridge('text',${name},${feature})">
</div>
<div th:fragment="number(name,feature)"
     th:replace="fragments/crud/new-input :: input-bridge('number',${name},${feature})">
</div>
<div th:fragment="password(name,feature)"
     th:replace="fragments/crud/new-input :: input-bridge('password',${name},${feature})">
</div>
<div th:fragment="email(name,feature)"
     th:replace="fragments/crud/new-input :: input-bridge('email',${name},${feature})">
</div>
</body>
</html>